3.8.69 \(\int (d+e x)^m (f+g x)^2 (a d e+(c d^2+a e^2) x+c d e x^2)^{-m} \, dx\) [769]

3.8.69.1 Optimal result
3.8.69.2 Mathematica [A] (verified)
3.8.69.3 Rubi [A] (verified)
3.8.69.4 Maple [A] (verified)
3.8.69.5 Fricas [A] (verification not implemented)
3.8.69.6 Sympy [F(-1)]
3.8.69.7 Maxima [A] (verification not implemented)
3.8.69.8 Giac [B] (verification not implemented)
3.8.69.9 Mupad [B] (verification not implemented)

3.8.69.1 Optimal result

Integrand size = 44, antiderivative size = 246 \[ \int (d+e x)^m (f+g x)^2 \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx=-\frac {2 (c d f-a e g) \left (a e^2 g+c d (d g (1-m)-e f (2-m))\right ) (d+e x)^{-1+m} \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c^3 d^3 e (1-m) (2-m) (3-m)}+\frac {2 g (c d f-a e g) (d+e x)^m \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c^2 d^2 e (2-m) (3-m)}+\frac {(d+e x)^{-1+m} (f+g x)^2 \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{1-m}}{c d (3-m)} \]

output
-2*(-a*e*g+c*d*f)*(a*e^2*g+c*d*(d*g*(1-m)-e*f*(2-m)))*(e*x+d)^(-1+m)*(a*d* 
e+(a*e^2+c*d^2)*x+c*d*e*x^2)^(1-m)/c^3/d^3/e/(1-m)/(2-m)/(3-m)+2*g*(-a*e*g 
+c*d*f)*(e*x+d)^m*(a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^(1-m)/c^2/d^2/e/(2-m)/ 
(3-m)+(e*x+d)^(-1+m)*(g*x+f)^2*(a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^(1-m)/c/d 
/(3-m)
 
3.8.69.2 Mathematica [A] (verified)

Time = 0.20 (sec) , antiderivative size = 131, normalized size of antiderivative = 0.53 \[ \int (d+e x)^m (f+g x)^2 \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx=-\frac {(d+e x)^{-1+m} ((a e+c d x) (d+e x))^{1-m} \left (2 a^2 e^2 g^2+2 a c d e g (f (-3+m)+g (-1+m) x)+c^2 d^2 \left (f^2 \left (6-5 m+m^2\right )+2 f g \left (3-4 m+m^2\right ) x+g^2 \left (2-3 m+m^2\right ) x^2\right )\right )}{c^3 d^3 (-3+m) (-2+m) (-1+m)} \]

input
Integrate[((d + e*x)^m*(f + g*x)^2)/(a*d*e + (c*d^2 + a*e^2)*x + c*d*e*x^2 
)^m,x]
 
output
-(((d + e*x)^(-1 + m)*((a*e + c*d*x)*(d + e*x))^(1 - m)*(2*a^2*e^2*g^2 + 2 
*a*c*d*e*g*(f*(-3 + m) + g*(-1 + m)*x) + c^2*d^2*(f^2*(6 - 5*m + m^2) + 2* 
f*g*(3 - 4*m + m^2)*x + g^2*(2 - 3*m + m^2)*x^2)))/(c^3*d^3*(-3 + m)*(-2 + 
 m)*(-1 + m)))
 
3.8.69.3 Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 237, normalized size of antiderivative = 0.96, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.068, Rules used = {1253, 1221, 1122}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (f+g x)^2 (d+e x)^m \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{-m} \, dx\)

\(\Big \downarrow \) 1253

\(\displaystyle \frac {2 (c d f-a e g) \int (d+e x)^m (f+g x) \left (c d e x^2+\left (c d^2+a e^2\right ) x+a d e\right )^{-m}dx}{c d (3-m)}+\frac {(f+g x)^2 (d+e x)^{m-1} \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m}}{c d (3-m)}\)

\(\Big \downarrow \) 1221

\(\displaystyle \frac {2 (c d f-a e g) \left (\frac {g (d+e x)^m \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m}}{c d e (2-m)}-\frac {\left (a e^2 g+c d (d g (1-m)-e f (2-m))\right ) \int (d+e x)^m \left (c d e x^2+\left (c d^2+a e^2\right ) x+a d e\right )^{-m}dx}{c d e (2-m)}\right )}{c d (3-m)}+\frac {(f+g x)^2 (d+e x)^{m-1} \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m}}{c d (3-m)}\)

\(\Big \downarrow \) 1122

\(\displaystyle \frac {2 (c d f-a e g) \left (\frac {g (d+e x)^m \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m}}{c d e (2-m)}-\frac {(d+e x)^{m-1} \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m} \left (a e^2 g+c d (d g (1-m)-e f (2-m))\right )}{c^2 d^2 e (1-m) (2-m)}\right )}{c d (3-m)}+\frac {(f+g x)^2 (d+e x)^{m-1} \left (x \left (a e^2+c d^2\right )+a d e+c d e x^2\right )^{1-m}}{c d (3-m)}\)

input
Int[((d + e*x)^m*(f + g*x)^2)/(a*d*e + (c*d^2 + a*e^2)*x + c*d*e*x^2)^m,x]
 
output
((d + e*x)^(-1 + m)*(f + g*x)^2*(a*d*e + (c*d^2 + a*e^2)*x + c*d*e*x^2)^(1 
 - m))/(c*d*(3 - m)) + (2*(c*d*f - a*e*g)*(-(((a*e^2*g + c*d*(d*g*(1 - m) 
- e*f*(2 - m)))*(d + e*x)^(-1 + m)*(a*d*e + (c*d^2 + a*e^2)*x + c*d*e*x^2) 
^(1 - m))/(c^2*d^2*e*(1 - m)*(2 - m))) + (g*(d + e*x)^m*(a*d*e + (c*d^2 + 
a*e^2)*x + c*d*e*x^2)^(1 - m))/(c*d*e*(2 - m))))/(c*d*(3 - m))
 

3.8.69.3.1 Defintions of rubi rules used

rule 1122
Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_S 
ymbol] :> Simp[e*(d + e*x)^(m - 1)*((a + b*x + c*x^2)^(p + 1)/(c*(p + 1))), 
 x] /; FreeQ[{a, b, c, d, e, m, p}, x] && EqQ[c*d^2 - b*d*e + a*e^2, 0] && 
EqQ[m + p, 0]
 

rule 1221
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c 
_.)*(x_)^2)^(p_), x_Symbol] :> Simp[g*(d + e*x)^m*((a + b*x + c*x^2)^(p + 1 
)/(c*(m + 2*p + 2))), x] + Simp[(m*(g*(c*d - b*e) + c*e*f) + e*(p + 1)*(2*c 
*f - b*g))/(c*e*(m + 2*p + 2))   Int[(d + e*x)^m*(a + b*x + c*x^2)^p, x], x 
] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && EqQ[c*d^2 - b*d*e + a*e^2, 0] 
 && NeQ[m + 2*p + 2, 0]
 

rule 1253
Int[((d_) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_.) + (b_.)*(x_) 
+ (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(-e)*(d + e*x)^(m - 1)*(f + g*x)^n* 
((a + b*x + c*x^2)^(p + 1)/(c*(m - n - 1))), x] - Simp[n*((c*e*f + c*d*g - 
b*e*g)/(c*e*(m - n - 1)))   Int[(d + e*x)^m*(f + g*x)^(n - 1)*(a + b*x + c* 
x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && EqQ[c*d^2 - b*d* 
e + a*e^2, 0] && EqQ[m + p, 0] && GtQ[n, 0] && NeQ[m - n - 1, 0] && (Intege 
rQ[2*p] || IntegerQ[n])
 
3.8.69.4 Maple [A] (verified)

Time = 2.12 (sec) , antiderivative size = 235, normalized size of antiderivative = 0.96

method result size
gosper \(-\frac {\left (c d x +a e \right ) \left (c^{2} d^{2} g^{2} m^{2} x^{2}+2 c^{2} d^{2} f g \,m^{2} x -3 c^{2} d^{2} g^{2} m \,x^{2}+2 a c d e \,g^{2} m x +c^{2} d^{2} f^{2} m^{2}-8 c^{2} d^{2} f g m x +2 g^{2} x^{2} c^{2} d^{2}+2 a c d e f g m -2 a c d e \,g^{2} x -5 c^{2} d^{2} f^{2} m +6 c^{2} d^{2} f g x +2 a^{2} e^{2} g^{2}-6 a c d e f g +6 c^{2} d^{2} f^{2}\right ) \left (e x +d \right )^{m} \left (c d e \,x^{2}+a \,e^{2} x +c \,d^{2} x +a d e \right )^{-m}}{c^{3} d^{3} \left (m^{3}-6 m^{2}+11 m -6\right )}\) \(235\)
risch \(-\frac {\left (c^{3} d^{3} g^{2} m^{2} x^{3}+a \,c^{2} d^{2} e \,g^{2} m^{2} x^{2}+2 c^{3} d^{3} f g \,m^{2} x^{2}-3 c^{3} d^{3} g^{2} m \,x^{3}+2 a \,c^{2} d^{2} e f g \,m^{2} x -a \,c^{2} d^{2} e \,g^{2} m \,x^{2}+c^{3} d^{3} f^{2} m^{2} x -8 c^{3} d^{3} f g m \,x^{2}+2 g^{2} x^{3} c^{3} d^{3}+2 a^{2} c d \,e^{2} g^{2} m x +a \,c^{2} d^{2} e \,f^{2} m^{2}-6 a \,c^{2} d^{2} e f g m x -5 c^{3} d^{3} f^{2} m x +6 c^{3} d^{3} f g \,x^{2}+2 a^{2} c d \,e^{2} f g m -5 a \,c^{2} d^{2} e \,f^{2} m +6 c^{3} d^{3} f^{2} x +2 a^{3} e^{3} g^{2}-6 a^{2} c d \,e^{2} f g +6 a \,c^{2} d^{2} e \,f^{2}\right ) \left (c d x +a e \right )^{-m} {\mathrm e}^{\frac {i \pi \,\operatorname {csgn}\left (i \left (c d x +a e \right ) \left (e x +d \right )\right ) m \left (-\operatorname {csgn}\left (i \left (c d x +a e \right ) \left (e x +d \right )\right )+\operatorname {csgn}\left (i \left (c d x +a e \right )\right )\right ) \left (-\operatorname {csgn}\left (i \left (c d x +a e \right ) \left (e x +d \right )\right )+\operatorname {csgn}\left (i \left (e x +d \right )\right )\right )}{2}}}{\left (-2+m \right ) \left (-3+m \right ) \left (-1+m \right ) c^{3} d^{3}}\) \(406\)
parallelrisch \(\frac {\left (-x^{3} \left (e x +d \right )^{m} c^{3} d^{3} e \,g^{2} m^{2}+3 x^{3} \left (e x +d \right )^{m} c^{3} d^{3} e \,g^{2} m -x \left (e x +d \right )^{m} c^{3} d^{3} e \,f^{2} m^{2}-6 x^{2} \left (e x +d \right )^{m} c^{3} d^{3} e f g +5 x \left (e x +d \right )^{m} c^{3} d^{3} e \,f^{2} m -\left (e x +d \right )^{m} a \,c^{2} d^{2} e^{2} f^{2} m^{2}+5 \left (e x +d \right )^{m} a \,c^{2} d^{2} e^{2} f^{2} m +6 \left (e x +d \right )^{m} a^{2} c d \,e^{3} f g -2 x \left (e x +d \right )^{m} a \,c^{2} d^{2} e^{2} f g \,m^{2}+6 x \left (e x +d \right )^{m} a \,c^{2} d^{2} e^{2} f g m -2 \left (e x +d \right )^{m} a^{3} e^{4} g^{2}-2 x^{3} \left (e x +d \right )^{m} c^{3} d^{3} e \,g^{2}-6 x \left (e x +d \right )^{m} c^{3} d^{3} e \,f^{2}-6 \left (e x +d \right )^{m} a \,c^{2} d^{2} e^{2} f^{2}-x^{2} \left (e x +d \right )^{m} a \,c^{2} d^{2} e^{2} g^{2} m^{2}-2 x^{2} \left (e x +d \right )^{m} c^{3} d^{3} e f g \,m^{2}+x^{2} \left (e x +d \right )^{m} a \,c^{2} d^{2} e^{2} g^{2} m +8 x^{2} \left (e x +d \right )^{m} c^{3} d^{3} e f g m -2 x \left (e x +d \right )^{m} a^{2} c d \,e^{3} g^{2} m -2 \left (e x +d \right )^{m} a^{2} c d \,e^{3} f g m \right ) \left (c d e \,x^{2}+a \,e^{2} x +c \,d^{2} x +a d e \right )^{-m}}{e \left (-2+m \right ) \left (-3+m \right ) \left (-1+m \right ) c^{3} d^{3}}\) \(506\)

input
int((e*x+d)^m*(g*x+f)^2/((a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^m),x,method=_RE 
TURNVERBOSE)
 
output
-(c*d*x+a*e)*(c^2*d^2*g^2*m^2*x^2+2*c^2*d^2*f*g*m^2*x-3*c^2*d^2*g^2*m*x^2+ 
2*a*c*d*e*g^2*m*x+c^2*d^2*f^2*m^2-8*c^2*d^2*f*g*m*x+2*c^2*d^2*g^2*x^2+2*a* 
c*d*e*f*g*m-2*a*c*d*e*g^2*x-5*c^2*d^2*f^2*m+6*c^2*d^2*f*g*x+2*a^2*e^2*g^2- 
6*a*c*d*e*f*g+6*c^2*d^2*f^2)*(e*x+d)^m/((c*d*e*x^2+a*e^2*x+c*d^2*x+a*d*e)^ 
m)/c^3/d^3/(m^3-6*m^2+11*m-6)
 
3.8.69.5 Fricas [A] (verification not implemented)

Time = 0.31 (sec) , antiderivative size = 350, normalized size of antiderivative = 1.42 \[ \int (d+e x)^m (f+g x)^2 \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx=-\frac {{\left (a c^{2} d^{2} e f^{2} m^{2} + 6 \, a c^{2} d^{2} e f^{2} - 6 \, a^{2} c d e^{2} f g + 2 \, a^{3} e^{3} g^{2} + {\left (c^{3} d^{3} g^{2} m^{2} - 3 \, c^{3} d^{3} g^{2} m + 2 \, c^{3} d^{3} g^{2}\right )} x^{3} + {\left (6 \, c^{3} d^{3} f g + {\left (2 \, c^{3} d^{3} f g + a c^{2} d^{2} e g^{2}\right )} m^{2} - {\left (8 \, c^{3} d^{3} f g + a c^{2} d^{2} e g^{2}\right )} m\right )} x^{2} - {\left (5 \, a c^{2} d^{2} e f^{2} - 2 \, a^{2} c d e^{2} f g\right )} m + {\left (6 \, c^{3} d^{3} f^{2} + {\left (c^{3} d^{3} f^{2} + 2 \, a c^{2} d^{2} e f g\right )} m^{2} - {\left (5 \, c^{3} d^{3} f^{2} + 6 \, a c^{2} d^{2} e f g - 2 \, a^{2} c d e^{2} g^{2}\right )} m\right )} x\right )} {\left (e x + d\right )}^{m}}{{\left (c^{3} d^{3} m^{3} - 6 \, c^{3} d^{3} m^{2} + 11 \, c^{3} d^{3} m - 6 \, c^{3} d^{3}\right )} {\left (c d e x^{2} + a d e + {\left (c d^{2} + a e^{2}\right )} x\right )}^{m}} \]

input
integrate((e*x+d)^m*(g*x+f)^2/((a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^m),x, alg 
orithm="fricas")
 
output
-(a*c^2*d^2*e*f^2*m^2 + 6*a*c^2*d^2*e*f^2 - 6*a^2*c*d*e^2*f*g + 2*a^3*e^3* 
g^2 + (c^3*d^3*g^2*m^2 - 3*c^3*d^3*g^2*m + 2*c^3*d^3*g^2)*x^3 + (6*c^3*d^3 
*f*g + (2*c^3*d^3*f*g + a*c^2*d^2*e*g^2)*m^2 - (8*c^3*d^3*f*g + a*c^2*d^2* 
e*g^2)*m)*x^2 - (5*a*c^2*d^2*e*f^2 - 2*a^2*c*d*e^2*f*g)*m + (6*c^3*d^3*f^2 
 + (c^3*d^3*f^2 + 2*a*c^2*d^2*e*f*g)*m^2 - (5*c^3*d^3*f^2 + 6*a*c^2*d^2*e* 
f*g - 2*a^2*c*d*e^2*g^2)*m)*x)*(e*x + d)^m/((c^3*d^3*m^3 - 6*c^3*d^3*m^2 + 
 11*c^3*d^3*m - 6*c^3*d^3)*(c*d*e*x^2 + a*d*e + (c*d^2 + a*e^2)*x)^m)
 
3.8.69.6 Sympy [F(-1)]

Timed out. \[ \int (d+e x)^m (f+g x)^2 \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx=\text {Timed out} \]

input
integrate((e*x+d)**m*(g*x+f)**2/((a*d*e+(a*e**2+c*d**2)*x+c*d*e*x**2)**m), 
x)
 
output
Timed out
 
3.8.69.7 Maxima [A] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 193, normalized size of antiderivative = 0.78 \[ \int (d+e x)^m (f+g x)^2 \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx=-\frac {{\left (c d x + a e\right )} f^{2}}{{\left (c d x + a e\right )}^{m} c d {\left (m - 1\right )}} - \frac {2 \, {\left (c^{2} d^{2} {\left (m - 1\right )} x^{2} + a c d e m x + a^{2} e^{2}\right )} f g}{{\left (m^{2} - 3 \, m + 2\right )} {\left (c d x + a e\right )}^{m} c^{2} d^{2}} - \frac {{\left ({\left (m^{2} - 3 \, m + 2\right )} c^{3} d^{3} x^{3} + {\left (m^{2} - m\right )} a c^{2} d^{2} e x^{2} + 2 \, a^{2} c d e^{2} m x + 2 \, a^{3} e^{3}\right )} g^{2}}{{\left (m^{3} - 6 \, m^{2} + 11 \, m - 6\right )} {\left (c d x + a e\right )}^{m} c^{3} d^{3}} \]

input
integrate((e*x+d)^m*(g*x+f)^2/((a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^m),x, alg 
orithm="maxima")
 
output
-(c*d*x + a*e)*f^2/((c*d*x + a*e)^m*c*d*(m - 1)) - 2*(c^2*d^2*(m - 1)*x^2 
+ a*c*d*e*m*x + a^2*e^2)*f*g/((m^2 - 3*m + 2)*(c*d*x + a*e)^m*c^2*d^2) - ( 
(m^2 - 3*m + 2)*c^3*d^3*x^3 + (m^2 - m)*a*c^2*d^2*e*x^2 + 2*a^2*c*d*e^2*m* 
x + 2*a^3*e^3)*g^2/((m^3 - 6*m^2 + 11*m - 6)*(c*d*x + a*e)^m*c^3*d^3)
 
3.8.69.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 929 vs. \(2 (232) = 464\).

Time = 0.54 (sec) , antiderivative size = 929, normalized size of antiderivative = 3.78 \[ \int (d+e x)^m (f+g x)^2 \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx=-\frac {{\left (e x + d\right )}^{m} c^{3} d^{3} g^{2} m^{2} x^{3} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + 2 \, {\left (e x + d\right )}^{m} c^{3} d^{3} f g m^{2} x^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + {\left (e x + d\right )}^{m} a c^{2} d^{2} e g^{2} m^{2} x^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} - 3 \, {\left (e x + d\right )}^{m} c^{3} d^{3} g^{2} m x^{3} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + {\left (e x + d\right )}^{m} c^{3} d^{3} f^{2} m^{2} x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + 2 \, {\left (e x + d\right )}^{m} a c^{2} d^{2} e f g m^{2} x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} - 8 \, {\left (e x + d\right )}^{m} c^{3} d^{3} f g m x^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} - {\left (e x + d\right )}^{m} a c^{2} d^{2} e g^{2} m x^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + 2 \, {\left (e x + d\right )}^{m} c^{3} d^{3} g^{2} x^{3} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + {\left (e x + d\right )}^{m} a c^{2} d^{2} e f^{2} m^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} - 5 \, {\left (e x + d\right )}^{m} c^{3} d^{3} f^{2} m x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} - 6 \, {\left (e x + d\right )}^{m} a c^{2} d^{2} e f g m x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + 2 \, {\left (e x + d\right )}^{m} a^{2} c d e^{2} g^{2} m x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + 6 \, {\left (e x + d\right )}^{m} c^{3} d^{3} f g x^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} - 5 \, {\left (e x + d\right )}^{m} a c^{2} d^{2} e f^{2} m e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + 2 \, {\left (e x + d\right )}^{m} a^{2} c d e^{2} f g m e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + 6 \, {\left (e x + d\right )}^{m} c^{3} d^{3} f^{2} x e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + 6 \, {\left (e x + d\right )}^{m} a c^{2} d^{2} e f^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} - 6 \, {\left (e x + d\right )}^{m} a^{2} c d e^{2} f g e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )} + 2 \, {\left (e x + d\right )}^{m} a^{3} e^{3} g^{2} e^{\left (-m \log \left (c d x + a e\right ) - m \log \left (e x + d\right )\right )}}{c^{3} d^{3} m^{3} - 6 \, c^{3} d^{3} m^{2} + 11 \, c^{3} d^{3} m - 6 \, c^{3} d^{3}} \]

input
integrate((e*x+d)^m*(g*x+f)^2/((a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^m),x, alg 
orithm="giac")
 
output
-((e*x + d)^m*c^3*d^3*g^2*m^2*x^3*e^(-m*log(c*d*x + a*e) - m*log(e*x + d)) 
 + 2*(e*x + d)^m*c^3*d^3*f*g*m^2*x^2*e^(-m*log(c*d*x + a*e) - m*log(e*x + 
d)) + (e*x + d)^m*a*c^2*d^2*e*g^2*m^2*x^2*e^(-m*log(c*d*x + a*e) - m*log(e 
*x + d)) - 3*(e*x + d)^m*c^3*d^3*g^2*m*x^3*e^(-m*log(c*d*x + a*e) - m*log( 
e*x + d)) + (e*x + d)^m*c^3*d^3*f^2*m^2*x*e^(-m*log(c*d*x + a*e) - m*log(e 
*x + d)) + 2*(e*x + d)^m*a*c^2*d^2*e*f*g*m^2*x*e^(-m*log(c*d*x + a*e) - m* 
log(e*x + d)) - 8*(e*x + d)^m*c^3*d^3*f*g*m*x^2*e^(-m*log(c*d*x + a*e) - m 
*log(e*x + d)) - (e*x + d)^m*a*c^2*d^2*e*g^2*m*x^2*e^(-m*log(c*d*x + a*e) 
- m*log(e*x + d)) + 2*(e*x + d)^m*c^3*d^3*g^2*x^3*e^(-m*log(c*d*x + a*e) - 
 m*log(e*x + d)) + (e*x + d)^m*a*c^2*d^2*e*f^2*m^2*e^(-m*log(c*d*x + a*e) 
- m*log(e*x + d)) - 5*(e*x + d)^m*c^3*d^3*f^2*m*x*e^(-m*log(c*d*x + a*e) - 
 m*log(e*x + d)) - 6*(e*x + d)^m*a*c^2*d^2*e*f*g*m*x*e^(-m*log(c*d*x + a*e 
) - m*log(e*x + d)) + 2*(e*x + d)^m*a^2*c*d*e^2*g^2*m*x*e^(-m*log(c*d*x + 
a*e) - m*log(e*x + d)) + 6*(e*x + d)^m*c^3*d^3*f*g*x^2*e^(-m*log(c*d*x + a 
*e) - m*log(e*x + d)) - 5*(e*x + d)^m*a*c^2*d^2*e*f^2*m*e^(-m*log(c*d*x + 
a*e) - m*log(e*x + d)) + 2*(e*x + d)^m*a^2*c*d*e^2*f*g*m*e^(-m*log(c*d*x + 
 a*e) - m*log(e*x + d)) + 6*(e*x + d)^m*c^3*d^3*f^2*x*e^(-m*log(c*d*x + a* 
e) - m*log(e*x + d)) + 6*(e*x + d)^m*a*c^2*d^2*e*f^2*e^(-m*log(c*d*x + a*e 
) - m*log(e*x + d)) - 6*(e*x + d)^m*a^2*c*d*e^2*f*g*e^(-m*log(c*d*x + a*e) 
 - m*log(e*x + d)) + 2*(e*x + d)^m*a^3*e^3*g^2*e^(-m*log(c*d*x + a*e) -...
 
3.8.69.9 Mupad [B] (verification not implemented)

Time = 12.13 (sec) , antiderivative size = 327, normalized size of antiderivative = 1.33 \[ \int (d+e x)^m (f+g x)^2 \left (a d e+\left (c d^2+a e^2\right ) x+c d e x^2\right )^{-m} \, dx=-\frac {\frac {g^2\,x^3\,{\left (d+e\,x\right )}^m\,\left (m^2-3\,m+2\right )}{m^3-6\,m^2+11\,m-6}+\frac {x\,{\left (d+e\,x\right )}^m\,\left (2\,a^2\,c\,d\,e^2\,g^2\,m+2\,a\,c^2\,d^2\,e\,f\,g\,m^2-6\,a\,c^2\,d^2\,e\,f\,g\,m+c^3\,d^3\,f^2\,m^2-5\,c^3\,d^3\,f^2\,m+6\,c^3\,d^3\,f^2\right )}{c^3\,d^3\,\left (m^3-6\,m^2+11\,m-6\right )}+\frac {a\,e\,{\left (d+e\,x\right )}^m\,\left (2\,a^2\,e^2\,g^2+2\,a\,c\,d\,e\,f\,g\,m-6\,a\,c\,d\,e\,f\,g+c^2\,d^2\,f^2\,m^2-5\,c^2\,d^2\,f^2\,m+6\,c^2\,d^2\,f^2\right )}{c^3\,d^3\,\left (m^3-6\,m^2+11\,m-6\right )}+\frac {g\,x^2\,\left (m-1\right )\,{\left (d+e\,x\right )}^m\,\left (a\,e\,g\,m-6\,c\,d\,f+2\,c\,d\,f\,m\right )}{c\,d\,\left (m^3-6\,m^2+11\,m-6\right )}}{{\left (c\,d\,e\,x^2+\left (c\,d^2+a\,e^2\right )\,x+a\,d\,e\right )}^m} \]

input
int(((f + g*x)^2*(d + e*x)^m)/(x*(a*e^2 + c*d^2) + a*d*e + c*d*e*x^2)^m,x)
 
output
-((g^2*x^3*(d + e*x)^m*(m^2 - 3*m + 2))/(11*m - 6*m^2 + m^3 - 6) + (x*(d + 
 e*x)^m*(6*c^3*d^3*f^2 - 5*c^3*d^3*f^2*m + c^3*d^3*f^2*m^2 + 2*a^2*c*d*e^2 
*g^2*m + 2*a*c^2*d^2*e*f*g*m^2 - 6*a*c^2*d^2*e*f*g*m))/(c^3*d^3*(11*m - 6* 
m^2 + m^3 - 6)) + (a*e*(d + e*x)^m*(2*a^2*e^2*g^2 + 6*c^2*d^2*f^2 - 5*c^2* 
d^2*f^2*m + c^2*d^2*f^2*m^2 - 6*a*c*d*e*f*g + 2*a*c*d*e*f*g*m))/(c^3*d^3*( 
11*m - 6*m^2 + m^3 - 6)) + (g*x^2*(m - 1)*(d + e*x)^m*(a*e*g*m - 6*c*d*f + 
 2*c*d*f*m))/(c*d*(11*m - 6*m^2 + m^3 - 6)))/(x*(a*e^2 + c*d^2) + a*d*e + 
c*d*e*x^2)^m